/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lolbatfsm.io;

import java.util.Collection;
import lolbatfsm.system.FSM;

/**
 * This interface must be implemented in order to listen to the results of each iteration
 * of the simulation, and to the eventual error messages.
 *
 * @author Matteo Battaglio <madbat87@gmail.com>
 */
public interface SimulationListener {

    /**
     * It is called by the Simulator when an error occurred during the simulation
     * @param errorMessage
     */
    void errorOccurred(String errorMessage);

    /**
     * It is called by the Simulator after each iteration is completed.
     * @param iterationDuration
     * @param fsms the collection of finite-state machines, with the updated states
     * and pending transitions
     */
    void iterationCompleted(int iterationDuration, Collection<FSM> fsms);

    /**
     * It is called by the Simulator when the simulation is over.
     */
    void simulationEnded();

}
